
#ifndef MACRO_C51_H
#define MACRO_C51_H

#include <intrins.h>
#define NOP() _nop_()
#define BYTE_ROTATE_LEFT(b, n)    _crol_(b, n)
#define BYTE_ROTATE_RIGHT(b, n)   _cror_(b, n)
#define WORD_ROTATE_LEFT(w, n)    _irol_(w, n)
#define WORD_ROTATE_RIGHT(w, n)   _iror_(w, n)
#define DWORD_ROTATE_LEFT(dw, n)  _lrol_(dw, n)
#define DWORD_ROTATE_RIGHT(dw, n) _lror_(dw, n)

#define ENABLE_ALL_INTERRUPTS()  {EA = 1;}
#define DISABLE_ALL_INTERRUPTS() {EA = 0;}

#endif